package ziye.eventbustest;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    private Button btn_frag;
    private Button btn_thread;
    private Button btn_service;

    private Activity mActivity;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initView();
        initData();
        initListener();
    }

    private void initListener() {
        btn_frag.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(mActivity,ActivityForFrag.class));
            }
        });
    }

    private void initData() {
        mActivity=this;
    }

    private void initView() {
        btn_frag= (Button) findViewById(R.id.go_frag);
        btn_thread= (Button) findViewById(R.id.go_thread);
        btn_service= (Button) findViewById(R.id.go_service);
    }
}
